public class GirlFriendTest {
    static void main() {
        GirlFriend[] arr = new GirlFriend[4];



        GirlFriend gf1 = new GirlFriend("梨花诗",18,"女","睡觉");
        GirlFriend gf2 = new GirlFriend("宁姚",23,"女","练剑");
        GirlFriend gf3 = new GirlFriend("小鸟游六花",17,"女","中二病");
        GirlFriend gf4 = new GirlFriend("刘亦菲",40,"女","唱歌");

        arr[0]=gf1;
        arr[1]=gf2;
        arr[2]=gf3;
        arr[3]=gf4;
        int sum=0;
        for(int i=0;i<arr.length;i++) {
            GirlFriend gf = arr[i];
            sum=sum+ gf.getAge();
        }
        int avg=sum/arr.length;
        for(int j=0;j<arr.length;j++) {
            GirlFriend gf = arr[j];
            if(gf.getAge()<avg) {
                System.out.println(gf.getName()+gf.getAge()+gf.getGender()+gf.getHobby());
            }
        }


    }
}
